layui.use(['form','laydate','table','loading'], function () {
    let form = layui.form,
        layer = layui.layer,
        $ = layui.$;


    // laydate.render({elem: '#end_time'});



    //监听提交
    form.on('submit(saveBtn)',function(data){
        $.ajax({
            url: '/admin/order/SaveSend?id='+$("input[name='id']").val(),
            type: 'post',
            dataType: 'json',
            data:data.field,
            success: function(res) {
                if (res.status == true) {
                    layer.msg('保存成功', {icon: 1, time: 1000},
                        function(){
                            parent.parent.location.reload();
                        })

                }
            },
            error: function(re) {

                layer.open({
                    title: '错误信息',
                    content: '<span style="color:red">'+re.responseJSON.errorCode+':</span>'+re.responseJSON.msg
                })
            }
        });
    })
});